package org.sidora.strata.context;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;
import org.openide.windows.TopComponent;


/**
 * Action which shows StrataProperties component
 * @author Enric Tartera, Juan Manuel Gimeno, Roger Masgoret
 * @version 1.0
 */
public class StrataPropertiesAction extends AbstractAction {
    
    public StrataPropertiesAction() {
        super(NbBundle.getMessage(StrataPropertiesAction.class, "CTL_StrataPropertiesAction"));
//        putValue(SMALL_ICON, new ImageIcon(Utilities.loadImage(StrataPropertiesTopComponent.ICON_PATH, true)));
    }
    
    public void actionPerformed(ActionEvent evt) {
        StrataPropertiesTopComponent win = StrataPropertiesTopComponent.findInstance();
        win.open();
        win.requestActive();
        win.fillEquals();
    }
    
    public void actionPerformed() {
        StrataPropertiesTopComponent win = StrataPropertiesTopComponent.findInstance();
        win.open();
        win.requestActive();
        //win.limpiar();
        win.fillEquals();
        win.fillEquivalence();
        win.fillNextTo();
        win.fillPreviousTo();
    }
    
    public void cerrar(){
        StrataPropertiesTopComponent win = StrataPropertiesTopComponent.findInstance();
        win.close();
    }
    
}
